package com.ruoyi.web.controller.wechat;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.controller.BaseControllerPlus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.WeChatUser;
import com.ruoyi.system.dto.WeChatUserDTO;
import com.ruoyi.system.service.IWeChatUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/wechat/user")
@Api(value = "微信用户管理" )
public class WeChatUserController extends BaseControllerPlus {

    @Autowired
    private IWeChatUserService weChatUserService;

    @GetMapping
    @ApiOperation(value = "获取微信用户信息"   )
    public TableDataInfo weChatUser(WeChatUserDTO dto) {

        Page<WeChatUser> page = new Page<>(dto.getPageNum(), dto.getPageSize());
        Page<WeChatUser> paged = weChatUserService.page(page);
        return getDataTable(paged);
    }

    @PostMapping
    @ApiOperation(value = "2获取微信用户信息")
    public TableDataInfo weChatUser2(@RequestBody  WeChatUserDTO dto) {


        Page<WeChatUser> page = new Page<>(dto.getPageNum(), dto.getPageSize());
        Page<WeChatUser> paged = weChatUserService.page(page);
        return getDataTable(paged);
    }
}
